package Ttt;

import java.util.Scanner;

public class E {
    public static void main(String[] args) {
        double money = 0;
        Scanner reader = new Scanner(System.in);
        int elep = reader.nextInt();
        int elenum = reader.nextInt();
        if(elep == 0 && elenum == 0)
            money = 0;
        if((elep<=0 && elenum>0) || elenum<0)
            System.out.println("invalid value");
        else{
            if(elep<1000) {
                if (elenum <= 180)
                    money = 0.52 * elenum;
                if(elenum>=181 && elenum <= 280)
                    money = 180 *0.52+0.57+(elenum-180-1)*0.05;
                if(elenum>=281)
                    money = 180 *0.52+0.82+(elenum-180-1)*0.30;
            }
            if(elep>=1000 && elep<10000) {
                if (elenum <= 180)
                    money = 0.47 * elenum;
                if(elenum>=181 && elenum <= 280)
                    money = 180 *0.47+0.52+(elenum-180-1)*0.05;
                if(elenum>=281)
                    money = 180 *0.52+0.77+(elenum-180-1)*0.30;
            }

        }
        System.out.printf("%.2f",money);
    }
}
